package com.istock.user.controller;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.istock.base.common.api.model.ApiBaseResponse;
import com.istock.base.common.api.model.RetStatusEnum;
import com.istock.base.enumration.BaseEnum;
import com.istock.base.enumration.Enums;
import com.istock.union.user.model.Constants;

@Controller
@RequestMapping("/s/enum")
public class EnumController {
    private static final Logger logger = LoggerFactory.getLogger(EnumController.class);

    @RequestMapping("findEnumByType")
    @ResponseBody
    public ApiBaseResponse<List<BaseEnum>> findEnumByType(String type) {
        List<BaseEnum> result = Enums.getInstance().getEnumsByType(type);
        return new ApiBaseResponse<>(RetStatusEnum.SUCCESS,Constants.API_RESPONSE_SUCCESS_CODE, 
                Constants.API_RESPONSE_SUCCESS_MESSAGE, result);
    }

}
